package test;

import static org.junit.Assert.*;
import junit.framework.Assert;
import modele.Point;
import modele.Polygone;
import org.junit.Test;

public class testPolygone {
	
	@Test
    public void testsymetrieX() {
		
         Point p = new Point(5,5);
         Point p2 = new Point(10,10);
         Point p3 = new Point(15,15);

         Polygone poly = new Polygone();
         poly.getListPoints().add(p);
         poly.getListPoints().add(p2);
         poly.getListPoints().add(p3);

         poly.symetrieX(new Point(0,0));
         Assert.assertEquals(-5,poly.getListPoints().get(0).getY());
         Assert.assertEquals(-10, poly.getListPoints().get(1).getY());
         Assert.assertEquals(-15, poly.getListPoints().get(2).getY());
    }

	@Test
    public void testequals() {
		
         Point p = new Point(5,9);
         Point r = new Point(8,4);
         
         Polygone poly = new Polygone();
         Polygone poly2 = new Polygone();
         Polygone poly3 = new Polygone();
         
         poly.getListPoints().add(p);
         poly2.getListPoints().add(p);
         poly3.getListPoints().add(r);

        Assert.assertEquals(true, poly.equals(poly2));
        Assert.assertEquals(false, poly.equals(poly3));
    }


}
